public class Score
{
    private int player1;
    private int player2;
    private int tie;

    public Score()
    {
        player1 = 0;
        player2 = 0;
        tie = 0;
    }

    public Score(int player1, int player2, int tie)
    {
        this.player1 = player1;
        this.player2 = player2;
        this.tie = tie;
    }

    public int getPlayer1(){return player1;}
    public void setPlayer1(int player1) { this.player1 = player1; }
    public int getPlayer2() { return player2; }
    public void setPlayer2(int player2) { this.player2 = player2; }
    public int getTie() { return tie; }
    public void setTie(int tie) { this.tie = tie; }
    public void increasePlayer1Score() { player1++; }
    public void increasePlayer2Score() { player2++; }
    public void increaseTie() { tie++; }
    public int getTotalGamesPlayed() { return player1 + player2 + tie; }

    public string getPlayer1WinPercentage() 
    {
        if (player1 + player2 + tie == 0)
            return "0.0%";
        return doubleToPercentage(player1 / (player1 + player2 + tie));
    }
    public string getPlayer1LosePercentage()
    {
        if (player1 + player2 + tie == 0)
            return "0.0%";
        return doubleToPercentage(player2 / (player1 + player2 + tie));
    }
    public string getPlayer1TiePercentage()
    {
        if (player1 + player2 + tie == 0)
            return "0.0%";
        return doubleToPercentage(tie / (player1 + player2 + tie));
    }
    public string getPlayer2WinPercentage()
    {
        return getPlayer1LosePercentage();
    }
    public string getPlayer2LosePercentage()
    {
        return getPlayer1WinPercentage();
    }
    public string getPlayer2TiePercentage()
    {
        return getPlayer1TiePercentage();
    }

    private string doubleToPercentage(double ratio)
    {
        return ratio.ToString("0.0%");
    }
}